﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GBits.ContactUtilites;

namespace GBits.ContactManager
{
    public partial class frmAddConnection : Form
    {
        public Related r { get; set; }
        private DataTable dst { get; set; }

        public frmAddConnection()
        {
            InitializeComponent();
        }

        private void btnAccept_Click(object sender, EventArgs e)
        {
            r = new Related(cboContact.SelectedValue.ToString(), cboContact.Text, tbConnection.Text);
            this.Close();
        }

        private void frmAddConnection_Load(object sender, EventArgs e)
        {
            dst = DataAccess.GetData().GetSimpleContactList();
            dst.DefaultView.Sort = "name";
            this.cboContact.DataSource = dst;
            this.cboContact.DisplayMember = "name";
            this.cboContact.ValueMember = "id";
        }
    }
}
